package com.cljz.makepassenger.ui.holder;

import android.graphics.Color;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.cljz.makepassenger.base.App;
import com.cljz.makepassenger.R;
import com.cljz.makepassenger.model.net.bean.GetTypeListBean;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by apple on 2017/4/26.
 */

public class NearbyTagsHolder extends RecyclerView.ViewHolder {

    @BindView(R.id.tv_nearby_tag)
    TextView tvNearbyTag;

    public NearbyTagsHolder(View itemView) {
        super(itemView);
        ButterKnife.bind(this, itemView);

    }

    public void setData(List<GetTypeListBean.DataBean> typeList, int position) {
        GetTypeListBean.DataBean dataBean = typeList.get(position);
        tvNearbyTag.setText(dataBean.getCate_name());
        if (dataBean.getSelect()) {
            tvNearbyTag.setTextColor(Color.parseColor("#e65757"));
            tvNearbyTag.setBackgroundResource(R.drawable.shape_nearby_tag_chacked_bg);
        } else {
            tvNearbyTag.setTextColor(App.getInstance().getResources().getColor(R.color.txt_black_color));
            tvNearbyTag.setBackgroundResource(R.drawable.shape_nearby_tag_normal_bg);
        }
    }

}
